package com.lmiot.xyclick.Activity;

import android.os.Bundle;
import android.text.TextUtils;
import com.lmiot.xyclick.Bean.DoAutoBean;
import com.lmiot.xyclick.Bean.SQL.AutoBean;
import com.lmiot.xyclick.Bean.SQL.AutoBeanSqlUtil;
import com.lkx.liandianqinew.R;
import com.lmiot.xyclick.Util.ClickUtils;
import com.lmiot.xyclick.Util.LogUtil;
import com.youyi.yyviewsdklibrary.Dialog.util.ToastUtil;
import org.greenrobot.eventbus.EventBus;

public class IntentActivity extends BaseActivity {
    @Override // android.support.v7.app.AppCompatActivity, android.support.v4.app.SupportActivity, android.support.v4.app.FragmentActivity, com.lmiot.xyclick.Activity.BaseActivity
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        requestWindowFeature(1);
        getWindow().setFlags(1024, 1024);
        setContentView(R.layout.activity_intent);
        String stringExtra = getIntent().getStringExtra("flag");
        if (!TextUtils.isEmpty(stringExtra)) {
            LogUtil.d("IntentActivity00", stringExtra);
            stringExtra.hashCode();
            if (stringExtra.equals("executeAuto")) {
                ClickUtils.Click(this);
                String stringExtra2 = getIntent().getStringExtra("autoID");
                LogUtil.d("IntentActivity00", stringExtra2);
                AutoBean searchByID = AutoBeanSqlUtil.getInstance().searchByID(stringExtra2);
                if (searchByID != null) {
                    EventBus.getDefault().post(new DoAutoBean(101, searchByID, null, 0));
                } else {
                    ToastUtil.warning(getString(R.string.ff10));
                }
            }
            finish();
        }
    }
}
